package com.arpa.wms.service.impl;

import com.arpa.wms.domain.consts.NumConst;
import com.arpa.wms.domain.dto.WavePickingItemDTO;
import com.arpa.wms.domain.entity.WavePickingItem;
import com.arpa.wms.mapper.WavePickingItemMapper;
import com.arpa.wms.service.IWavePickingItemService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: rfwang
 * @Date 2021/02/27
 * @Description: 波次拣货明细Service
 */
@Service
@Log4j2
public class WavePickingItemServiceImpl extends ServiceImpl<WavePickingItemMapper, WavePickingItem> implements IWavePickingItemService {

    /**
     * 查询波次明细信息
     * @param query
     * @return
     */
    @Override
    public List<WavePickingItem> queryWavePickingItemList(WavePickingItemDTO query) {
        return this.list(new QueryWrapper<WavePickingItem>().lambda().eq(WavePickingItem::getPickingCode, query.getPickingCode())
                .eq(WavePickingItem::getGoodsCode, query.getGoodsCode()).eq(WavePickingItem::getLocation, query.getLocation()).eq(WavePickingItem::getDeleted, NumConst.NUM_ZERO));
    }
}
